package com.li.springtest;

import com.li.entity.People;
import org.junit.Test;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.ClassPathResource;

/**
 * @Description：
 * @Author：LiDong
 * @Create：2020/10/17
 * @Version：1.0.0
 */
public class TestSpring {

    @Test
    public void test1(){
        ClassPathResource resource=new ClassPathResource("peopleBean.xml");
        DefaultListableBeanFactory factory=new DefaultListableBeanFactory();
        XmlBeanDefinitionReader reader=new XmlBeanDefinitionReader(factory);
        reader.loadBeanDefinitions(resource);

        People people = factory.getBean(People.class);
        people.showMessage();
    }







}
